/**   
 * Copyright © 2018 eSunny Info. Tech Ltd. All rights reserved.
 * 
 * @Package: controller 
 * @author: suneee   
 * @date: 2018年12月7日 下午3:48:29 
 */
/**
 * @ClassName: package-info
 * @Description: TODO
 * @author: suneee
 * @date: 2018年12月7日 下午3:48:29
 */
package com.wzd.springmvc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.wzd.springmvc.entity.UserEntity;
import com.wzd.springmvc.service.HelloService;

@Controller
@RequestMapping(value = "/hello")
public class HelloController {
	
@Autowired
private HelloService helloService;
	
	@RequestMapping(value = "/word", method = RequestMethod.GET)
	public String hello(Model model) {
		model.addAttribute("msg", "你好spring mvc");
		System.out.println("HelloController.hello()");
		
		UserEntity userentity = helloService.getUserById("1");
		System.out.println(userentity.toString());
		return "index";
	}
}